<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<style>
    .messageLog{
        height: 360px;
        margin-bottom: 20px;
/*        background-color: #FDFDFC;*/
        margin-left: 10px;
        background: none repeat scroll 0 0 #FDFDFD;
        border: 1px solid #DDD;
    }
    .well{
        margin-left: 10px;
        padding: 7px 15px;
    }
    .name{
        font-size: 10px;
        font-weight:bold;
    }
    form{
        margin:0px;
    }
    ul{
        margin: 0px;
    }
    .bs-docs-example {
        border-radius: 1px;
    }
</style>

<div class="span12">
    
    <div class="span8">
        <div id="success" ></div>
        <div id="error"></div>
        <span id="sending" class="label label-inverse"  style="display: none; ">Sending...</span>
<!--        <div id="sending" style="display: none; background-color: lightgreen">Sending..</div>-->
        <div class="well" align="center" style="  padding: 20px;">
        <?php
        //var_dump($project);
        

        echo $this->Form->create('Retrospective', array('url' => '../retrospectives/add', 'class'=>'form-inline' ,'id'=>'retrosForm'));
        ?> 
        <fieldset> 

            <?php 
                $sprint=0;
                if (isset($this->params['pass'][1]))  $sprint=$this->params['pass'][1];
                echo $this->Form->input('sprint',array('type' => 'hidden','value'=>$sprint,'id'=>'sprint'));
                echo $this->Form->input('project_id',array('type' => 'hidden','value'=>$idProject,'id'=>'project_id'));
                echo $this->Form->input('creator_id',array('type' => 'hidden','value'=>AuthComponent::user('id'),'id'=>'creator_id'));

                $options = array('label'=>false,'class'=>'input','div'=>false,'rows'=>3,'id'=>'retroMg');
                echo $this->Form->input('message',$options);
                $arrOptionsMember=array();
                $arrOptionsMember["0"]="bueno";
                $arrOptionsMember["1"]="malo";
                $arrOptionsMember["2"]="actividad";

                ?>


                <?php
                //$optionsLabelRes = array('class' => 'control-label','style'=>'padding-right:20px','text'=>'Responsable');
                echo $this->Form->input('type', array(
                            'options' => $arrOptionsMember,/*'class'=>'chzn-select',*/'class'=>'input','div'=>false,'id'=>'type',

                            'label' => false
                        ));?>
            <input class="btn btn-primary" id="submitRetros" type="submit" value="Agregar">
                        <?php
                      //  $optionsBtn = array('label' => 'Agregar','class' => 'btn btn-primary','div'=>false);

//                        echo $this->Js->submit('Agregar',array(
//                            'before'=>$this->Js->get('#sending')->effect('fadeIn'),
//                            'success'=>$this->Js->get('#sending')->effect('fadeOut'),
//                            'update'=>'#success',
//                            'url' => array('controller' => 'retrospectives','action' => 'add'),
//                             'label' => 'Agregar','class' => 'btn btn-primary','div'=>false
//                        ));
                        
                        echo $this->Form->end();//$optionsBtn
                        ?>


            </fieldset>
            </div>
            
 <!--VERDADERO RETROSPECTIVE-->
        <div>
            <?php /*var_dump($retros);*/?>
            <div class="row-fluid">
                <div class="span12">
                    
            
                <?php for ($j=0;$j<3;$j++){ ?>
                <div class="span4" id="box_estado<?php echo $j;?>">  
                    <div id="estado<?php echo $j;?>" class="well" style=" margin-left:0px;
                            background: <?php 
                            if ($j==0)echo "#50B350"; 
                            if ($j==1)echo "#EC4200";
                            if ($j==2)echo "#3A87AD";
                        ?>;
                            color: white;
                            border-radius: 1px;
                            padding: 10px;
                        " >
                        <?php 
                            if ($j==0)echo "Bueno";
                            if ($j==1)echo "Malo";
                            if ($j==2)echo "Actividad";
                        ?>
                    </div>
                <?php 

                    for ($i=0; $i<count($retros);$i++){    
                        if ($retros[$i]['Retrospective']['type']==$j){?>
                            <div id="<?php echo $retros[$i]['Retrospective']['id'] ?>" class="bs-docs-example">
                                <ul class="nav nav-pills pull-right"><!--
                                    <li>
                                    <?php

                                    echo $this->Form->postLink(
                                                    '<i class="icon-trash"></i>', //le image
                                                    '/stories/delete/'.$retros[$i]['Retrospective']['id'], //,le url
                                                    array('escape' => false,'confirm' => 'Are you sure?','class' => 'nav-pills'));

                                                ?>   
                                    </li>
-->                                </ul>
                                <p> 
                                    <?php echo $retros[$i]['Retrospective']['message']?> 
                                </p>

                             </div>
                            <?php } 

                            }?>
                            <ul></ul>
                            <ul id="app_estado<?php echo $j;?>">
                            </ul>
                            </div>
                                
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>
    <div class="span4">

            <div class="widget-box widget-chat" style=" margin-top: 0px;">
                    <div class="widget-title">
                            <span class="icon">
                                    <i class="icon-comment"></i>
                            </span>
                            <h5>Chat</h5>
                            <div id="user" style="display: none;">
                                <?php echo AuthComponent::user('username');?>
                            </div>
                            <div id="gravatar" style="display: none;"><?php echo AuthComponent::user('gravatar');?></div>
                            <div id="idProject" style="display: none;"><?php echo $idProject;?></div>
                    </div>
                    <div class="widget-content nopadding">
<!--                            <div class="chat-content panel-left">                   -->
                                <div class="chat-messages" id="chat-messages">
                                    <div id="chat-messages-inner">
                                        <ul>
                                            
                                        </ul>
                                        
<!--                                        <p id="msg-2" class="user-you" style="display: block;">
                                            <img src="img/demo/av1.jpg" alt="">
                                            <span class="msg-block">
                                                <strong>You</strong> 
                                                <span class="time">- 21:24</span>
                                                <span class="msg">hola</span>

                                            </span>
                                        </p>-->

                                    </div>	
<!--                                    <div  class="messageLog">
                                        <ul>
                                            This will be populated dynamically. 
                                        </ul>
                                    </div>
                                                   -->
                                </div>
                                <form class="chat-message well" id="chatForm">
                                            <button class="btn btn-success">Send</button>  
                                            <span class="input-box">
                                                    <input type="text" name="message" id="chatMsg">
                                            </span>										                  
                                </form>                   
<!--                            </div>-->
<!--                            <div class="chat-users panel-right">
                                    <div class="panel-title"><h5>Online Users</h5></div>
                                    <div class="panel-content nopadding">
                                            <ul class="contact-list">
                                                    <li id="user-michelle" class="online new"><a href="#"><img alt="" src="img/demo/av1.jpg"> <span>Michelle</span></a><span class="msg-count badge badge-info">3</span></li>

                                                    <li id="user-cartoon-man" class="online"><a href="#"><img alt="" src="img/demo/av3.jpg"> <span>Cartoon Man</span></a></li>
                                                    <li id="user-rick-newton" class="online"><a href="#"><img alt="" src="img/demo/av1.jpg"> <span>Rick Newton</span></a></li>
                                                    <li id="user-zack-renson" class="online new"><a href="#"><img alt="" src="img/demo/av2.jpg"> <span>Zack Renson</span></a><span class="msg-count badge badge-info">1</span></li>
                                                    <li id="user-vladimir-ivanov"><a href="#"><img alt="" src="img/demo/av3.jpg"> <span>Wladimir Ivanov</span></a></li>
                                                    <li id="user-master-moda"><a href="#"><img alt="" src="img/demo/av1.jpg"> <span>Master Moda</span></a></li>
                                            </ul>
                                    </div>
                            </div>-->
                    </div>
            </div>
    </div>
                
     
</div>
 
<!-- This is simple CHAT - what can I say, it's realtime. -->
 
<!--<div class="messageLog">
<ul>
 This will be populated dynamically. 
</ul>
</div>
 
<form>
 
<input type="text" name="message"  />
 
<button type="submit" >Send</button>
 
</form>-->
 
 

<!-- --------------------------------------------------- -->
<!-- --------------------------------------------------- -->
<!-- --------------------------------------------------- -->
<!-- --------------------------------------------------- -->
 
 
<!-- PubNub configuration details. -->
<div
id="pubnub"
pub-key="pub-7b6592f6-4ddb-4af6-b1b3-0e74cefe818d"
sub-key="sub-f4baaac5-87e0-11e0-b5b4-1fcb5dd0ecb4"
origin="pubsub.pubnub.com"
ssl="off">
</div>
 
